<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String userInfoDtosJson = (String)request.getAttribute("userInfoDtosJson");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>北京市电子行政监察平台-报送发起</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/frame.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jQueryTree-1.2.1.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.6.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/util.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/oacore.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/multi_upload.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/init.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.metadata.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.validate.fixed.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/jQueryTree-1.2.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/AccountBook2.js"></script>
		<script type="text/javascript">
				$(function () {
					//上报人 
					var accountBookJsonStr1 = "<%=userInfoDtosJson%>";		
					new AccountBook({
							input: $(".use-account-book"),
							mode: "checkbox",
							defaultValue: [],
							data: $.parseJSON(accountBookJsonStr1),
							pretreatment: function (data) {
								data.id = data.userInfoId;
								delete data.userInfoId;
								data.content = data.userName;
								delete data.userName;
								return data;
							}
						});

					//审批人 
					var accountBookJsonStr2 = "<%=userInfoDtosJson%>";		
					new AccountBook({
							input: $(".use-accountbook"),
							mode: "single",
							defaultValue: [],
							data: $.parseJSON(accountBookJsonStr2),
							pretreatment: function (data) {
								data.id = data.userInfoId;
								delete data.userInfoId;
								data.content = data.userName;
								delete data.userName;
								return data;
							}
						});
					


					//初始化表单值校验器
					$("#creatorForm").validate();
					//初始化报送方式选择器
					$(".report-method[checked!='']:first").trigger("click");
					
					//初始化时间选择器
					$("input.use-datepicker").bind("focus", function () {
							WdatePicker({
									dateFmt: "yyyy-MM-dd",
									minDate: "%y-%M-{%d}"
								});
						});
					$("input.datepicker-low").bind("focus", function () {
						var dpHigh=$dp.$("dpMax");
						WdatePicker(
							{
								dateFmt: "yyyy-MM-dd",
								minDate: "%y-%M-{%d}",
								maxDate: "#F{$dp.$D(\'dpMax\')}"
							}
						);
					});
					$("input.datepicker-high").bind("focus", function () {
						var dpMax=$dp.$("dpMax");
						var dpLow=$dp.$("dpLow");
						WdatePicker(
							{
								dateFmt: "yyyy-MM-dd",
								minDate: "#F{$dp.$D(\'dpLow\')}",
								maxDate: "#F{$dp.$D(\'dpMax\')}"
							}
						);
					});

				
					//初始化去向选择器
					$("input.nextstep-option").bind("click", function () {
							var $this = $(this);
							if($this.hasClass("nextstep-option-submit"))
								$("tr.nextstep-submit").show();
							else if($this.hasClass("nextstep-option-promotion"))
								$("tr.nextstep-submit").hide();
						}).filter(":checked").trigger("click");
					//初始化上报方式选择器
					$("input.report-method-selector").bind("click", function () {
							var $this = $(this);
							if($this.hasClass("report-method-attachment"))
								$("#templateSelector").hide();
							else if($this.hasClass("report-method-onlineform"))
								$("#templateSelector").show();
						}).filter(":checked").trigger("click");
					//触发选择
					new oacore.Widget.MultiUpload({
						fileList: $("#uploadFileList"),
						trigger: $("#uploadFileTrigger"),
						descriptionName: "description",
						fileName: "files"
					});	
				});
		</script>
		<style type="text/css">
			div {
				position: static;
			}
		</style>
	</head>
	<body>
		<div id="mainPage" class="surround-layout">
			<jsp:include page="../../frame/top.jsp" flush="true"></jsp:include>
			<div class="middle">
				<jsp:include page="../../frame/middle_left.jsp" flush="true">
					<jsp:param value="1001-1006" name="view"/>
				</jsp:include>
				<!-- 右侧输出内容 -->
				<div class="right">
					<div class="right-all-content">
						<div>
							<div class="content-line-wrap">
								<div class="content-line-left content-line">
									<h1 class="content-title">
										<span>
											<a href="<%=path %>/web/toMissionListAction.action">待办任务</a>
										</span>
										<span>
											&gt;&gt;
										</span>
										<span>
											<a href="<%=path %>/web/launchReportAction.action?jobId=${jobId}&fromFlag=task">处理</a>
										</span>
									</h1>
								</div>
							</div>
							<div class="inner-dialog">
								<h1 class="inner-dialog-title">
									报送发起
								</h1>
								<div class="inner-dialog-content">
									<form method="post" action="<%=path%>/web/startReportAction.action" name="creatorForm" id="creatorForm" enctype="multipart/form-data" class="normal-form">
										<input type="hidden" name="fromFlag" value="task"/>
										<h1 class="inner-form-title">报送任务信息</h1>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														报送任务名称:
													</td>
													<td colspan="3" class="dvt-value">
														<s:property value="missionDto.missionName"/>
														<input type="hidden" name="missionDto.missionId" value="${missionDto.missionId}"/>
														<input type="hidden" name="missionDto.missionName" value="${missionDto.missionName}"/>
														<input type="hidden" name="missionDto.missionCode" value="${missionDto.missionCode}"/>
													</td>
												</tr>
												<tr class="even">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														来源:
													</td>
													<td class="dvt-value">
														<s:property value="missionDto.importanceDTO.value"/>
														<input type="hidden" name="missionDto.importanceDTO.dataValueId" value="${missionDto.importanceDTO.dataValueId}"/>
													</td>
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														任务计划结束日期:
													</td>
													<td class="dvt-value">
														<s:date name="missionDto.scheduleEndDate" format="yyyy-MM-dd"/>
														<input type="hidden" value="<s:date name='missionDto.scheduleEndDate' format='yyyy-MM-dd'/>" id="dpMax"/>
													</td>
												</tr>
												<tr class="odd">
													<td class="dvt-filed">
														任务描述:
													</td>
													<td colspan="3" class="dvt-value">
														<s:property value="missionDto.description"/>
													</td>
												</tr>
											</tbody>
										</table>
										<h1 class="inner-form-title">报送要求</h1>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														报送开始日期:
													</td>
													<td class="dvt-value">
														<input type="text" id="dpLow" name="launchReportJobDto.reportStartDate" class="shadow tft-textinput datepicker-low {required: true, lteDate: '#dpMax', messages: {required: '报送开始日期项为必选', lteDate: '报送开始日期不得大于任务结束日期'}}"/>
													</td>
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														报送结束日期:
													</td>
													<td class="dvt-value">
														<input type="text" id="dpHigh" name="launchReportJobDto.reportEndDate"  class="shadow tft-textinput datepicker-high {required: true, gteDate: '#dpLow', lteDate: '#dpMax', messages: {required: '报送结束日期项为必选', gteDate: '报送结束日期不得小于报送开始日期', lteDate: '报送结束日期不得大于任务开始日期'}}"/>
													</td>
												</tr>
												<tr class="even two-field">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														报送人:
													</td>
													<td class="dvt-value" colspan="3">
														<input type="text" name="userInfoIds" class="shadow tft-textinput use-account-book {required: true, messages: {required: '报送人项为必选'}}"/>
														<div style="margin-top: 4px;color: #666666;">
															说明：请选择本次需要进行报送机构或个人，若选择机构，任务将发送至该机构下所有人。
														</div>
													</td>
												</tr>
												<tr class="odd">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														报送类型:
													</td>
													<td class="dvt-value" colspan="3">
														<div style="height: 24px;">
															<label class="odd" style="float: left;">
																<input type="radio" name="launchReportJobDto.reportMethod" value="F" checked="checked" class="report-method-selector report-method-attachment {required: true, messages: {required: '报送方式项为必选'}}" />信息文字
															</label>
															<label class="even" style="float: left;margin-left: 8px;margin-right: 8px;">
																<input type="radio" name="launchReportJobDto.reportMethod" value="B" class="report-method-selector report-method-onlineform {required: true, messages: {required: '报送方式项为必选'}}"/>数据材料
															</label>
															<span id="templateSelector" style="display: none;">
																<s:select name="launchReportJobDto.flowFormDto.formId" list="flowFormDtos" listKey="formId" cssClass="inputform-select _hide {showedRequired: true, messages: {showedRequired: '请选择一个电子表单模板'}}" listValue="formName" value="formId" headerKey="" headerValue="请选择电子表单模板" theme="simple" ></s:select> 
																<a>自定义excel表格</a>
															</span>
														</div>
														<div style="margin-top: 4px;color: #666666;clear: both;">
															说明：信息文字类内容以附件形式报送，数据材料类内容以在线表单形式报送。
														</div>
													</td>
												</tr>
												<tr class="even">
													<td class="dvt-filed">
														报送要求:
													</td>
													<td colspan="3" class="dvt-value">
														<textarea name="launchReportJobDto.reportRequirement"  class="shadow tft-textarea {maxlength: 64, messages: {maxlength: '报送要求项的长度不能超过64个字符'}}"></textarea>
													</td>
												</tr>
												<tr class="odd">
													<td class="dvt-filed">
														添加附件:
													</td>
													<td colspan="3" class="dvt-value">
														<ul class="file-list" id="uploadFileList">
														</ul>
														<button id="uploadFileTrigger">上传文件</button>
													</td>
												</tr>
											</tbody>
										</table>
										<table class="data-view-table tiny-form-table" cellspacing="0">
											<tbody>
												<tr class="odd">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														下一步去向:
													</td>
													<td class="dvt-value">
														<label class="tft-radiolabel odd">
															<input type="radio" name="launchReportJobDto.reportChannel" value="submit" class="nextstep-option nextstep-option-submit" checked="checked"/> 提交审批（将上报要求交给领导审批）
														</label>
														<label class="tft-radiolabel even">
															<input type="radio" name="launchReportJobDto.reportChannel" value="sure" class="nextstep-option nextstep-option-promotion"/> 发起（直接发起此次数据上报）
														</label>
													</td>
												</tr>
												<tr class="even nextstep-submit" style="display: none;">
													<td class="dvt-filed">
														<span class="important-field-star">*</span>
														选择批示人:
													</td>
													<td class="dvt-value">
														<input type="text" name="launchReportJobDto.approval.userInfoId" class="shadow tft-textinput  use-accountbook {required: true, messages: {required: '下一审批人项为必选'}}"/>
													</td>
												</tr>
											</tbody>
										</table>
										<table>
											<tr>
												<td>
													<input type="submit" value="确定" class="special originate"></input>
												</td>
											</tr>
										</table>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!--  -->
			</div>
		</div>
	</body>
</html>